package liu.per.dict;

/**
 * Created by liuj on 2015/4/19.
 */
public class Main {

    public static void main(String[] args) {
        DictTree root = new DictTree();
        DictTree dictTree = new DictTree();
        dictTree.add(root, "abc");
        for (int i : dictTree.getNodeSet()) {
            String origin = dictTree.getChildren()[i].getOrigin();
        }

        dictTree.add(root, "bc");
        dictTree.add(root, "acdasdf");
        dictTree.add(root, "ffcadf");
        //searcn abc
        String toSearch = "ffcd";
        for (int i = 0; i < toSearch.length(); i++) {
            int offset = toSearch.charAt(i) - 'a';
            root = root.getChildren()[offset];
            if (root == null) {
                System.out.println("no " + toSearch);
                break;
            }
        }


    }

}
